package com.lpit.controller;


import com.lpit.vo.ArticleVo;
import com.lpit.result.ResponseResult;
import com.lpit.dto.UserHomeDto;
import com.lpit.vo.UserVo;
import com.lpit.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserPageController {

    @Autowired
    private UserService userService;
    /**查询用户获得点赞数，粉丝，关注数据*/
    @GetMapping("/home.do")
    public ResponseResult<UserVo> getUserHomeLoad(UserHomeDto userHomeDto){
        return userService.getUserHome(userHomeDto);
    }
    /**查询用户发布的内容*/
    @GetMapping("/article.do")
    public ResponseResult<List<ArticleVo>> getUserArticleLoad(UserHomeDto userHomeDto){
        return userService.getUserArticle(userHomeDto);
    }
    /**查询用户的最热十条内容*/
    @GetMapping("/article/sort.do")
    public ResponseResult<List<ArticleVo>> getUserArticleSortLoad(UserHomeDto userHomeDto){
        return userService.getUserArticleSort(userHomeDto);
    }
}
